package com.xunshibao.tutor.common;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.xunshibao.tutor.po.School;
import com.xunshibao.tutor.po.School.TYPE;

@Service
public class SchoolServiceImpl {
	@Autowired
	private SchoolDaoImpl dao;
    public List<School> listAll() {
    	return null;
    }
    
    public List<School> listUiversityByProvince(Integer provinceId) {
    	return dao.getUnivByType(School.TYPE.UNIVERSITY, provinceId);
    }
    
    public School gettUiversity(Integer code) {
    	return getSchoolByCode(TYPE.UNIVERSITY, code);
    }
    
    public List<School> listHighSchoolByDist(Integer distinctId) {
    	return dao.getUnivByType(School.TYPE.HIGH, distinctId);
    }
    
    public List<School> listJuniorSchoolByDist(Integer distinctId) {
    	return dao.getUnivByType(School.TYPE.JUNIOR, distinctId);
    }
    
    public List<School> listCollegeByDist(Integer distinctId) {
    	return dao.getUnivByType(School.TYPE.COLLEGE, distinctId);
    }
    
    private School getSchoolByCode(School.TYPE type, Integer code) {
    	return dao.getSchoolByCode(type, code);
    }
}
